<?php /* SVN: $Id: view.ctp 2888 2010-08-30 10:12:30Z boopathi_026ac09 $ */ ?>
<div class="banner-content banner-view-content">
	<div class="banner container_24">
		<h2 class="project-title"><?php echo $this->Html->link($this->Html->cText($user['User']['username']), array('controller' => 'users', 'action' => 'view', $user['User']['username']), array('escape' => false));?></h2>
		<p class="project-author"><?php echo $user['User']['username'].' '.__l('joined').' '.Configure::read('site.name').' '.__l('on').' '.$this->Html->cDate($user['User']['created']);?></p>
	</div>
</div>
<div class="clearfix main-inner1 container_24">
	<div class="side1 user-menu view-banner clearfix grid_19">
	<div class="clearfix">
		<div class="clearfix js-tabs banner-tabs-content ui-tabs">
			<ul class="project-list clearfix banner-tabs ui-tabs-nav">
				<li><em></em><?php echo $this->Html->link(__l('Activity'), array('controller' => 'activities', 'action' => 'index', 'type' => 'user', 'info' => $user['User']['id']), array('title' => __l('Activity'), 'rel' => 'address:/' . str_replace(' ', '_', 'activity'))); ?></li>
				<li><em></em><?php echo $this->Html->link(__l('<em class="tab-txt">'.'Projects Posted'.'</em>').'<span>'.$this->Html->cInt($project_count, false).'</span>', array('controller' => 'projects', 'action' => 'index', 'type' => 'userview', 'cat' => 'myprojects', 'user' => $user['User']['id'], 'limit' => 6),array('title'=>__l('Projects Posted'),'rel' => 'address:/' . str_replace(' ', '_', 'projects posted'),'escape' => false)); ?></li>
			<?php if (Configure::read('Project.is_enable_idea')): ?>
				<li><em></em><?php echo $this->Html->link(__l('<em class="tab-txt">'.'Ideas Posted'.'</em>').'<span>'.$this->Html->cInt($idea_count, false).'</span>', array('controller' => 'projects', 'action' => 'index', 'type' => 'userview', 'cat' => 'ideaproject', 'user' => $user['User']['id'], 'limit' => 6),array('title'=>__l('Ideas Posted'),'rel' => 'address:/' . str_replace(' ', '_', 'ideas posted'),'escape' => false)); ?></li>
			<?php endif; ?>
				<li><em></em><?php echo $this->Html->link(__l('<em class="tab-txt">'.'Projects Funded'.'</em>').'<span>'.$this->Html->cInt($user['User']['unique_project_fund_count'], false).'</span>', array('controller' => 'projects', 'action' => 'index', 'type' => 'userview', 'cat' => 'fundedptojects', 'user' => $user['User']['id'], 'limit' => 6), array('title' => __l('Projects Funded'), 'rel' => 'address:/' . str_replace(' ', '_', 'projects funded'),'escape' => false)); ?> </li>
				<?php  if (Configure::read('Project.is_project_follower_enabled')): ?>
					<li><em></em><?php echo $this->Html->link(__l('<em class="tab-txt">'.'Following Projects'.'</em>').'<span>'.$this->Html->cInt($user['User']['project_follower_count'], false).'</span>', array('controller' => 'projects', 'action' => 'index', 'type' => 'userview', 'cat' => 'followingprojects', 'user' => $user['User']['id'], 'limit' => 6), array('title' => __l('Following Projects'), 'rel' => 'address:/following_projects','escape' => false)); ?></li>
				<?php endif; ?>
			</ul>
		</div>
		</div>
		<?php if($this->Auth->user('user_type_id') == ConstUserTypes::Admin): ?>
			<div class="admin-tabs-block clearfix">
				<div class="js-tabs">
					<ul>
            <li><em></em><?php echo $this->Html->link(__l('<em class="tab-txt">'.'User Logins'.'</em>').'<span>'.$this->Html->cInt($user['User']['user_login_count'], false).'</span>', array('controller' => 'user_logins', 'action' => 'index', 'user' => $user['User']['id'],'limit' => 20, 'admin'=>true),array('title'=>__l('User Logins'),'rel' => 'address:/user_login','escape' => false)); ?></li>
			<!--<li><em></em><?php echo $this->Html->link(__l('User Logins'), array('controller' => 'user_logins', 'action' => 'index', 'user' => $user['User']['id'], 'limit' => 20, 'admin' => true), array('title' => __l('User Logins'), 'rel' => 'address:/user_login')); ?><span><?php echo $this->Html->cInt($user['User']['user_login_count'], false); ?></span></li>-->
					</ul>
				</div>
			</div>
		<?php endif; ?>
	</div>
	<div class="user-side2 grid_right">
<div class="l-curve-top">
					<div class="r-curve-top">
                        <div class="top-bg"></div>
                    </div>
				</div>

<div class="shad-bg-lft clearfix">
					<div class="shad-bg-rgt">
						<div class="shad-bg">

	
	<div class="main-section">
			<div class="user-image">
				<?php echo $this->Html->getUserAvatar($user['User']['id'], 'user_view_thumb'); ?>
			</div>
<div class="clearfix">
            <?php if($this->Auth->user('id') == $user['User']['id']): ?>
			
				<div class="right-link grid_right"><?php echo $this->Html->link(__l('Edit'), array('controller' => 'user_profiles', 'action' => 'edit'), array('class' => 'edit')); ?></div>
			<?php endif; ?>
	
				<h4 class="grid_left usr-name"><?php
				echo $this->Html->link($this->Html->cText($user['User']['username']), array('controller' => 'users', 'action' => 'view',  $user['User']['username'], 'admin' => false), array('escape' => false, 'title'=>$this->Html->cText($user['User']['username'], false))); ?>
                </h4>
                </div>
				<?php
					$location = array();
					$place = '';
					if(!empty($user['UserProfile']['first_name']) || !empty($user['UserProfile']['last_name'])){
						echo $user['UserProfile']['first_name'] .' '. $user['UserProfile']['last_name'];
					}
					if (!empty($user['UserProfile']['City']['name'])) :
						$location[] = $user['UserProfile']['City']['name'];
					endif;
					if (!empty($user['UserProfile']['Country']['name'])) :
						$location[] = $user['UserProfile']['Country']['name'];
					endif;
					$place = implode(', ', $location);
				?>
				<?php if ($place): ?>
					<address><?php if(!empty($user['UserProfile']['Country']['iso2'])): ?><span class="flags flag-<?php echo strtolower($user['UserProfile']['Country']['iso2']); ?>" title ="<?php echo $user['UserProfile']['Country']['name']; ?>"><?php echo $user['UserProfile']['Country']['name']; ?></span><?php echo  ' ' . $place; ?><?php endif; ?></address>
				<?php endif; ?>
				<?php if($user['User']['username'] != $this->Auth->user('username')): ?>
					<p>
						<?php
							if($this->Auth->user('id')):
								echo $this->Html->link(__l('Send a message'), array('controller' => 'messages', 'action' => 'compose', 'user' => $user['User']['username']), array('class' => 'js-colorbox cboxelement msg', 'escape' => false,'title'=>__l('Send a message')));
							else:
								echo $this->Html->link(__l('Send a message'), array('controller' => 'users', 'action' => 'login/?f='.$this->request->url), array('escape' => false,'class' => 'msg', 'title'=>__l('Send a message')));
							endif;
						?>
					</p>
				<?php endif; ?>
		
			<?php if (!empty($user['UserProfile']['about_me'])): ?>
				<div class="project-info clearfix">
					<?php echo $this->Html->cText($user['UserProfile']['about_me']);?>
				</div>
			<?php endif;
            if (!empty($user['UserWebsite'])) { ?>
                      <div class="clearfix fund-category">
                        <h3><?php echo __l('Websites');?></h3>
                        <ul class="menu-sidebar">
                          <?php
											foreach ($user['UserWebsite'] as $userWebsite) :
												if(!empty($userWebsite['website'])) {
										?>
                          <li><a href="<?php echo $userWebsite['website'];?>" target="_blank"><?php echo $this->Html->cText($userWebsite['website']);?></a></li>
                          <?php
												}
											endforeach;
										?>
                        </ul>
                      </div>
                      <?php } 

				if(Configure::read('user.is_show_payapl_seal') && !empty($user['UserProfile']['paypal_account']) ):
					echo $this->Html->link($this->Html->image('http://images.paypal.com/images/verification_seal.gif'), 'https://cms.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_ID=security/verification_faq', array('title' => __l('This item is offered by a verified PayPal user'), 'target' => '_blank', 'escape' => false));
				endif;

			?>

		<?php
		if (!empty($user['UserWebsite'])): ?>
			<div class="clearfix fund-category">
				<h3><?php echo __l('Websites');?></h3>
				<ul class="menu-sidebar">
					<?php foreach ($user['UserWebsite'] as $userWebsite) :
						if(!empty($userWebsite['website'])){
					?>
						<li><a href="<?php echo $userWebsite['website'];?>" target="_blank"><?php echo $this->Html->cText($userWebsite['website']);?></a></li>
					<?php
						}
					endforeach;?>
				</ul>
			</div>
		<?php endif;?>
	</div>
</div>
</div>
</div>
<div class="l-curve-bot">
							<div class="r-curve-bot">
                                <div class="bot-bg"></div>
                            </div>
						</div>

	</div>
</div>